// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   MenuElement.java

package app;

import java.io.IOException;
import java.io.PrintStream;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import ui.Element;

public class MenuElement extends Element
{

    public MenuElement(String url, int index, int top)
    {
        super(0, top);
        super.selectable = true;
        super.clickable = true;
        this.url = url;
        try
        {
            String str = "/images/menu/menu_0" + index + ".jpg";
            img = Image.createImage(str);
            str = "/images/menu/menu_over_0" + index + ".jpg";
            imghover = Image.createImage(str);
            super.height = img.getHeight();
            super.width = img.getWidth();
        }
        catch(IOException e)
        {
            System.out.println("error Apa : ? " + e.getMessage());
        }
    }

    public void draw(Graphics g, int x, int y, int startY, int stopY, boolean selected)
    {
        y += super.top;
        if(selected)
            g.drawImage(imghover, x - 25, y, 20);
        else
            g.drawImage(img, x - 25, y, 20);
    }

    public String url;
    private Image img;
    private Image imghover;
}
